package liangtWorkSpace.springTest.sett;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liangt
 * @ClassName: SetterTest
 * @title: SetterTest
 * @projectName liangtWorkSpace.springTest.sett
 * @description: TODO
 * @date 2020/10/13 16:18
 */
public class SetterTest {

    /**
     * 测试Spring Bean--通过xml配置
     * person1 通过setter设值配置完成bean配置
     * person2 通过构造函数完成Bean配置
     */
    @Test
    public void test1(){
        String xmlPath = "applicationContextSetter.xml";

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);

        System.out.println(applicationContext.getBean("person1"));
        System.out.println(applicationContext.getBean("person2"));
    }
}
